package com.fenghongzhang.a18102;

import android.content.Context;
import android.util.Log;

import com.alibaba.android.arouter.facade.Postcard;
import com.alibaba.android.arouter.facade.annotation.Interceptor;
import com.alibaba.android.arouter.facade.callback.InterceptorCallback;
import com.alibaba.android.arouter.facade.template.IInterceptor;

@Interceptor(priority = 2,name = "测试")
public class TestIntercept implements IInterceptor {
    private static final String TAG = "TestIntercept";
    @Override
    public void process(Postcard postcard, InterceptorCallback callback) {
        //通过
        callback.onContinue(postcard);
        //拦截
//        Log.i(TAG, "process: 拦截");
//        callback.onInterrupt(new RuntimeException("拦截了."));
    }

    //只会执行一次.
    @Override
    public void init(Context context) {

    }
}
